<template>
  <u-navbar
    v-if="showNavbar"
    v-bind="$attrs"
    :background="background"
    :titleColor="titleColor"
    :backIconColor="backIconColor"
    :custom-back="onCustomBack"
    v-on="$listeners"
  />
</template>
<script>

export default {
  props: {
    showNavbar: {
      type: Boolean,
      default: true
    },
    background: {
      type: [Object, String],
      default: () => {
        return {
          background: '#387cf6'
        };
      }
    },
    titleColor: {
      type: [Object, String],
      default: '#fff'
    },
    backIconColor: {
      type: [Object, String],
      default: '#fff'
    }
  },
  methods: {
    onCustomBack() {
      uni.navigateBack();
    }
  }
};
</script>
